﻿//======================================================
//==     (c)2008 aspxcms inc by NeTCMS v1.0              ==
//==          Forum:bbs.aspxcms.com                   ==
//==         Website:www.aspxcms.com                  ==
//======================================================
using System;
using System.Collections.Generic;
using System.Data;
using NetCMS.Model;
using NetCMS.DALFactory;

namespace NetCMS.Content
{
    public class AdminGroup
    {
        private IAdminGroup agc;
        public AdminGroup()
        {
            agc = DataAccess.CreateAdminGroup();
        }

        public int add(NetCMS.Model.AdminGroupInfo agci)
        {
            int result = agc.add(agci);
            return result;
        }

        public int Edit(NetCMS.Model.AdminGroupInfo agci)
        {
            int result = agc.Edit(agci);
            return result;
        }

        public void Del(string id)
        {
            agc.Del(id);
        }

        public DataTable getInfo(string id)
        {
            DataTable dt = agc.getInfo(id);
            return dt;
        }

        public DataTable getClassList(string col, string TbName, string sqlselect)
        {
            DataTable dt = agc.getClassList(col, TbName, sqlselect);
            return dt;
        }

        public DataTable getColCname(string colname, string TbName, string classid, string id)
        {
            DataTable dt = agc.getColCname(colname, TbName, classid, id);
            return dt;
        }

        /// <summary>
        /// 根据管理员编号读取所属会员组编号
        /// </summary>
        /// <param name="userNum">会员编号</param>
        /// <returns></returns>
        public string getAdminGroup(string userNum)
        {
            return agc.getAdminGroup(userNum);
        }

        /// <summary>
        /// 获取管理员组信息
        /// </summary>
        /// <param name="UserGroupNumber">管理员组编号</param>
        /// <returns></returns>
        public IDataReader getAdminGroups(string UserGroupNumber)
        {
            return agc.getAdminGroups(UserGroupNumber);
        }

        /// <summary>
        /// 判断管理员是不是超级管理员
        /// </summary>
        /// <param name="usernum"></param>
        /// <returns></returns>
        public string GetAdminIsSuper(string usernum)
        {
            return agc.GetAdminIsSuper(usernum);
        }
    }
}
